import gtk
import os

def return_folder_mime():
    type = "stock_folder"
    return type

def return_mime(file):
    ext = os.path.splitext(file)[1]
    if ext == ".txt": 
        type = "gnome-mime-text"
    elif ext == ".sh":
        type = "gnome-mime-application-x-shellscript"
    elif ext == ".py":
        type = "gnome-mime-text-x-python"
    elif ext == ".pyc":
        type = "gnome-mime-application-x-python-bytecode"
    elif ext == ".php":
        type = "gnome-mime-application-x-php"
    elif ext == ".html":
        type = "gnome-mime-text-html"
    elif ext == ".zip" or ext == ".rar" or ext == ".bz2" or ext == ".gz":
        type = "gnome-mime-application-x-compress"
    elif ext == ".pdf":
        type = "gnome-mime-application-pdf"
    elif ext == ".doc" or ext == ".odt":
        type = "gnome-mime-application-vnd.oasis.opendocument.text"
    elif ext == ".png" or ext == ".jpg":
        type = "image-x-generic"
    elif ext == ".mp3" or ext == ".ogg":
        type = "audio-x-generic"
    elif ext == ".wmv" or ext == ".mpg" or ext == ".avi" or ext == ".mov":
        type = "video-x-generic"
    elif ext == ".exe" or ext == ".msi":
        type = "gnome-mime-application-x-ms-dos-executable"
    else: 
        type ="unknown"
    return type